xsm: streamline xsm_default_action()
authorJan Beulich <jbeulich@suse.com>
Fri, 28 Feb 2014 16:13:47 +0000 (17:13 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 28 Feb 2014 16:13:47 +0000 (17:13 +0100)
The privileges being strongly ordered is better reflected by using fall
through within the respective switch statement.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
xen/include/xsm/dummy.h

index a84218d58a0a431a75fe2209d51a153281edfd33..3bcd9414c15b5b7b5ae5ab66e9b51f649479e9ce 100644 (file)
@@ -59,20 +59,14 @@ static always_inline int xsm_default_action(
     switch ( action ) {
     case XSM_HOOK:
         return 0;
-    case XSM_DM_PRIV:
-        if ( src->is_privileged )
-            return 0;
-        if ( target && src->target == target )
-            return 0;
-        return -EPERM;
     case XSM_TARGET:
         if ( src == target )
             return 0;
-        if ( src->is_privileged )
-            return 0;
+        /* fall through */
+    case XSM_DM_PRIV:
         if ( target && src->target == target )
             return 0;
-        return -EPERM;
+        /* fall through */
     case XSM_PRIV:
         if ( src->is_privileged )
             return 0;